package game
{
	import flash.display.Sprite;
	import game.controller.command.GameCommand;
	import game.model.config.GameConfig;
	import game.view.panel.load.LoadPanel;

	import morn.App;
	import morn.core.handlers.Handler;
	import game.model.GameData;
	public class Entry
	{
		public function Entry()
		{
		}
		
		public function start(main:Sprite):void
		{
			if (main.stage==null) return;
			App.init(main);
			ZooMain.init(main);
			initlization(main);
			//
		}
		
		private function initlization(main:Sprite):void
		{
			//trace("CarEntry initlization");
			ZooMain.loader.registerViewAssets(LoadPanel,"assets/load.swf?vvv="+GlobalConfig.version,"assets/comp.swf?vvv="+GlobalConfig.version);
			
		
			//
			ZooMain.controller.registerCommand(GameCommand);
			
			ZooMain.sound.setUseLocalConfig(false);
		
			onLoadedConfig();
			
		}
		
		private function loadGameConfig():void
		{
			ZooMain.loader.loadConfigAssets(new Handler(onLoadedConfig));
		}
		
		private function onLoadedConfig():void
		{
			//
			showGame();
		}
		
		private function showGame():void
		{
			ZooMain.view.showView(LoadPanel);
		}
	
		private function showTipContent(text:String):void 
		{
			//var commonTip:CommonTipView = CommonTipView.instance;
			//commonTip.update(text);
			//App.tip.addChild(commonTip);
		}
		
		
	}
}